﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using WindowsInput.Native;

namespace UniPie
{
	/// <summary>
	/// Defines several conditions which should be matched by the user's system in order to invoke
	/// a Response.
	/// </summary>
	public class TriggerState
	{
		/// <summary>
		/// The key/mouse combo which should be held.
		/// </summary>
		public ObservableCollection<VirtualKeyCode> KeyboardMouseCombo { get; set; }

		/// <summary>
		/// The application which should be focused.
		/// </summary>
		public ApplicationFilter ApplicationFilter { get; set; }

		/// <summary>
		/// The mouse should be in the area defined here. Currently unimplemented.
		/// </summary>
		public ScreenArea ScreenArea { get; set; }

		public TriggerState()
		{
			KeyboardMouseCombo = new ObservableCollection<VirtualKeyCode>();
			ApplicationFilter = new ApplicationFilter();
			ScreenArea = new ScreenArea();
		}

		/// <summary>
		/// Deep copy constructor.
		/// </summary>
		public TriggerState(TriggerState ts)
		{
			KeyboardMouseCombo = new ObservableCollection<VirtualKeyCode>(ts.KeyboardMouseCombo);
			ApplicationFilter = new ApplicationFilter(ts.ApplicationFilter);
			ScreenArea = new ScreenArea(ts.ScreenArea);
		}

		public TriggerState(ObservableCollection<VirtualKeyCode> TheKeyboardMouseCombo, ApplicationFilter TheApplicationFilter, ScreenArea TheScreenArea)
		{
			KeyboardMouseCombo = TheKeyboardMouseCombo;
			ApplicationFilter = TheApplicationFilter;
			ScreenArea = TheScreenArea;
		}
	}
}
